// pages/mine/coupons/coupons.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
      tab_idx:1,
      page_height:'',
      cash_ticket:[],
      discount_ticket:{
          use:[
              {
                  id:0,
                  type:"满减优惠券",
                  condition:"499",
                  discount:"80.00",
                  ctime_start:22454554,
                  ctime_end: 8712885,
              }, {
                  id: 0,
                  type: "满减优惠券",
                  condition: "499",
                  discount: "80.00",
                  ctime_start: 22454554,
                  ctime_end: 8712885,
              }, {
                  id: 0,
                  type: "满减优惠券",
                  condition: "499",
                  discount: "80.00",
                  ctime_start: 22454554,
                  ctime_end: 8712885,
              }
          ],
          disable:[
              {
                  id: 0,
                  type: "满减优惠券",
                  condition: "499",
                  discount: "80.00",
                  ctime_start: 22454554,
                  ctime_end: 8712885,
              }
          ]
      }
  },

  // switch tab切换
  tab_switch:function(e){
    const idx = e.target.dataset.idx;
    console.log(idx)
    this.setData({tab_idx:idx});
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const that = this;
    wx.getSystemInfo({
        success: function (res) {
            that.setData({
                page_height:res.windowHeight
            })
        }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})